package com.dingding.javabasic.config;

import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author liugongding
 * @description:
 * @date 2022/8/23 9:12 PM
 */
public class MyThreadPoolConfig {

    public static ThreadPoolExecutor threadPoolExecutor() {
        return new ThreadPoolExecutor(
                10,
                30,
                10,
                TimeUnit.SECONDS,
                new LinkedBlockingDeque<>(1000),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy()
        );
    }
}
